median_sources = [
    'median_abi.cpp',
    'median.cpp',
    'interface/i_median.cpp'
]

median_static_lib = static_library(
  'Median',
  median_sources,
  include_directories: include_dirs,
  dependencies: [dev_deps],
  install: false
)

median_lib = shared_library(
    'Median',
    include_directories: include_dirs,
    dependencies: [libmcpp_deps],
    name_prefix: 'lib',
    name_suffix: 'so',
    install: true,
    install_dir: drivers_install_dir,
    link_whole: [median_static_lib]
)

median_dep = declare_dependency(
    link_with: median_lib,
    dependencies: [libmcpp_deps],
)

if build_tests and meson_build
  custom_target(
    'copy_libMedian',
    output: 'copy_libMedian',
    command: ['cp', median_lib.full_path(), drivers_install_dir],
    depends: median_lib,
    build_by_default: true,
  )
endif
